<?php
/**
 * Product media data template
 *
 * @see Mage_Catalog_Block_Product_View_Media
 */
?>
<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
?>
<?php
    $_product = $this->getProduct();
    $_helper = $this->helper('catalog/output');
?>
<p class="product-image">
	<a rel="lightbox[em_lightbox]"  href="<?php echo $this->helper('catalog/image')->init($_product, 'image'); ?>"  title="<?php echo $this->htmlEscape($this->getImageLabel())?>">
    <?php
        $_img = '<img id="image" src="'.$this->helper('catalog/image')->init($_product, 'image')->resize(265).'" alt="'.$this->htmlEscape($this->getImageLabel()).'" title="'.$this->htmlEscape($this->getImageLabel()).'" />';
        echo $_helper->productAttribute($_product, $_img, 'image');
    ?>
	</a>
</p>
<?php if (count($this->getGalleryImages()) > 0): ?>
<div class="more-views">
    <h2><?php echo $this->__('More Views') ?></h2>
    
	<ul>
    <?php $i = 0; foreach ($this->getGalleryImages() as $_image): ?>
	<?php if ($i > 0 && $i%3 == 0): ?>
		</ul><ul>
	<?php endif; ?>
        <li class="<?php echo $i%3 == 0 ? 'first' : (($i+1)%3 == 0 ? 'last' : '') ?>">
            <a rel="lightbox[em_lightbox]"  href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile()); ?>"  title="<?php echo $this->htmlEscape($_image->getLabel()) ?>">
				<img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->keepFrame(false)->resize(56); ?>" width="56" alt="<?php echo $this->htmlEscape($_image->getLabel()) ?>" />
			</a>
        </li>
    <?php $i++; endforeach; ?>
	</ul>
    
</div>
<?php endif; ?>
